widget: No longer postpone style-updated on unrealized widgets
authorBenjamin Otte <otte@redhat.com>
Sat, 14 May 2016 16:35:27 +0000 (18:35 +0200)
committerBenjamin Otte <otte@redhat.com>
Sat, 14 May 2016 16:48:22 +0000 (18:48 +0200)
commitddcf47026dbbe58dca3b34c7bb1ec63bb50a861a
treec5d250f9bf657324324c3b07d5fd11a16ab4c79f
parent30d2dc49a88bcd584f9858de83509339de574f89
widget: No longer postpone style-updated on unrealized widgets

GTK used to not emit GtkWidget::style-updated on widgets that weren't
realized. This sped up construction of complex widgetry in the early
days of GTK3 where we instantly invalidated on every change.
We don't do that anymore, so in theory (and in my limited testing with
widget-factory) this shouldn't be a prolem anymore.

What is a problem though is that postponing style-updated leads to 2
problems:
(1) Unrealized widgets will not emit style-updated which may cause them
    to not properly update their state and return wrong values from
    get_preferred_width/height() etc
(2) Emitting style-updated during realize can happen too late.
    When a widget is not made child-visible by its parent (common
    examples: notebook, paned) it will also not be realized when the
    parent is initially shown. However, when they get realized later
    (after a resize of the parent), they will emit style-updated (and
    potentially queue a resize) during size-allocate.

https://bugzilla.gnome.org/show_bug.cgi?id=765700
gtk/gtkwidget.c
gtk/gtkwidgetprivate.h